import java.util.Scanner;
public class sushu1 {
public static void main(String[] args) {
        System.out.println("请输入一个整数(1-n): ");
        Scanner shuzi = new Scanner(System.in);
        int n = shuzi.nextInt();
	if( n == 1)
	{
		System.out.println("1不是素数也不是合数 ");
	}
	else if( n!=1)
	{
	System.out.println("n以内的素数: ");
       	for(int i = 2;i <= n;i++)
        {
                for(int j = 2;j <= n;j++)
                        if(i%j == 0)
                        {
                                if(j < i)
                                        break;
                                if(j == i)
                                        System.out.println(i+ " ");
                        }
        }
	}
}
}


